package com.firestone.dao.primary.center;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.firestone.bean.dto.menu.MenuDTO;
import com.firestone.bean.entity.mysql.primary.ImCenterMenu;

/**
 * <p>
 * DM-center菜单表 Mapper 接口
 * </p>
 *
 * @author CAIYJ
 * @since 2018-03-26
 */
public interface ImCenterMenuDao extends BaseMapper<ImCenterMenu> {

    /**
     * @Description: TODO(菜单列表)
     * @param pagination
     * @param wrapper
     * @return
     * @author CAIYJ
     * @date 2018年3月30日 下午3:24:08
     * @lastModifier CAIYJ
     */
    @Select("<script>  "
            + "SELECT cm.`name`, cm.`describe`, cm.create_time, cm.update_time, cm.id, cm.is_delete, icm.real_name AS create_user, icm1.real_name AS update_user "
            + "FROM im_center_menu AS cm "
            + "LEFT JOIN im_center_manager AS icm ON icm.id = cm.creator "
            + "LEFT JOIN im_center_manager AS icm1 ON icm1.id = cm.reviser "
            + "<where> ${ew.sqlSegment} </where> </script> ")
    <T> List<MenuDTO> selectMenuList(Pagination pagination,
            @Param("ew") Wrapper<T> wrapper);
}
